package com.lgc.garylianglib.util.config;

import android.app.Application;

import org.greenrobot.eventbus.EventBus;

import me.dkzwm.widget.srl.IRefreshViewCreator;
import me.dkzwm.widget.srl.SmoothRefreshLayout;
import me.dkzwm.widget.srl.extra.footer.ClassicFooter;
import me.dkzwm.widget.srl.extra.header.ClassicHeader;


/**
 * @autor feijin_lgc
 * <p>
 * create at 2017/9/9 12:15
 */
public class MyApplication extends Application {

    protected static MyApplication mApp;

    @Override
    public void onCreate() {
        super.onCreate();
        mApp = this;
        SmoothRefreshLayout.setDefaultCreator(new IRefreshViewCreator() {
            @Override
            public void createHeader(SmoothRefreshLayout layout) {
                ClassicHeader header = new ClassicHeader(layout.getContext());
                header.setLastUpdateTimeKey("header_last_update_time");
                layout.setHeaderView(header);
            }

            @Override
            public void createFooter(SmoothRefreshLayout layout) {
                ClassicFooter footer = new ClassicFooter(layout.getContext());
                footer.setLastUpdateTimeKey("footer_last_update_time");
                layout.setFooterView(footer);
            }
        });
    }


    public static MyApplication getInstance() {
        return mApp;
    }

}
